<?php
$filename = "hb.txt";


echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";

//判断文件是否存在，如果存在
if(file_exists($filename)){
	echo "<br>";
	//以追加读的方式打开文件
	$myfile = fopen($filename, "a+");
	//fwrite($myfile, "黄彪测试");
	$content = fgets($myfile,255);
	fclose($myfile);
	echo $content;
	echo "<br>";
	echo "<br>";
	echo filetype($filename);
	echo "<br>";
	echo "<br>";
	echo date('Y-m-d h:m:s',filemtime($filename));
	echo "<br>";
	echo "<br>";
	echo date('Y-m-d h:m:s',fileatime($filename));
}else{
	//以追加读的方式打开文件
	$myfile = fopen($filename, "a+");
	fwrite($myfile, "黄彪测试");
	$content = fgets($myfile,255);
	fclose($myfile);
	echo $content;
	
}


?>